/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: #f8fafc;
    color: #333;
    line-height: 1.6;
    padding-top: 60px; /* 预留顶部导航高度 */
}

/* 顶部固定导航 */
.admin-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #2563eb; /* 与前台主色一致 */
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000; /* 确保在内容上方 */
}

.header-container {
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 左侧：Logo和前台入口 */
.admin-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: white;
    text-decoration: none;
}

.to-frontend {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.to-frontend:hover {
    background-color: rgba(255,255,255,0.1);
}

/* 中间：后台功能导航 */
.admin-nav {
    display: flex;
    gap: 20px;
}

.nav-item {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 15px;
    padding: 6px 0;
    position: relative;
}

.nav-item.active {
    color: white;
    font-weight: 500;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: white;
}

.nav-item:hover {
    color: white;
}

/* 右侧：用户信息 */
.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-size: 14px;
}

.logout-btn {
    color: rgba(255,255,255,0.9);
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

/* 主内容容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* 页面标题 */
.page-title {
    font-size: 24px;
    color: #1e293b;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

/* 按钮样式（与前台统一） */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-default {
    background-color: #94a3b8;
    color: white;
}

.btn-default:hover {
    background-color: #64748b;
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.data-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #475569;
}

.data-table tr:hover {
    background-color: #f8fafc;
}

/* 表单样式 */
.form-container {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.form-hint {
    margin-top: 5px;
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
}

/* 响应式适配 */
@media (max-width: 992px) {
    .admin-nav {
        gap: 15px;
    }
    .nav-item {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 15px;
    }
    .admin-logo {
        gap: 10px;
    }
    .logo-text {
        font-size: 16px;
    }
    .admin-nav {
        display: none; /* 小屏幕可改为汉堡菜单，这里简化处理 */
    }
    .container {
        padding: 20px 15px;
    }
    .form-container {
        padding: 20px;
    }
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 14px;
    }
}